import { baseUrlConfig } from "@/config/config";
import request from "@/utils/request";

// const bastPath = baseUrlConfig.processBaseUrl
const bastPath = baseUrlConfig.processBaseUrl;
// const eventInfo = '/info'

/**
 * 获取树形结构数据
 */
export const eventRulesFindTree = (data: any) => {
  return request({
    url: bastPath + "/event/eventType/tree",
    method: "post",
    data,
  });
};

/**
 * 新增事件类型
 */
export const eventRulesAppendType = (data: any) => {
  return request({
    url: bastPath + "/event/eventType/append",
    method: "post",
    data,
  });
};
/**
 * 编辑事件类型
 */
export const eventRulesEditType = (data: any) => {
  return request({
    url: bastPath + "/event/eventType/change",
    method: "post",
    data,
  });
};
/**
 * 删除事件类型
 */
export const eventRulesDeleteType = (data: any) => {
  return request({
    url: bastPath + "/event/eventType/delete",
    method: "post",
    data,
  });
};
/**
 * 导入
 */
export const eventRulesImport = (data: any) => {
  return request({
    url: bastPath + "/event/eventType/import",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
};
/**
 * 模板文件下下载
 */
export const eventRulesTemplateDownload = (data: any) => {
  return request({
    url: bastPath + "/event/eventType/templateDownload",
    method: "post",
    responseType: "blob",
    data,
  });
};
/**
 * 事件信息分页查询
 */
export const eventInfoFindPage = (data: any) => {
  return request({
    url: bastPath + "/event/eventInfo/find/page",
    method: "post",
    data,
  });
};
/**
 * 事件信息新增
 */
export const eventInfoAppend = (data: any) => {
  return request({
    url: bastPath + "/event/eventInfo/append",
    method: "post",
    data,
  });
};
/**
 * 事件信息编辑
 */
export const eventInfoUpdate = (data: any) => {
  return request({
    url: bastPath + "/event/eventInfo/update",
    method: "post",
    data,
  });
};
/**
 * 事件信息状态修改
 */
export const eventInfoUpdateStatus = (data: any) => {
  return request({
    url: bastPath + "/event/eventInfo/updateStatus",
    method: "post",
    data,
  });
};
